mylinkfandomcom-20200214-history
DevOpsMemo
=Background= This page is created out of LearningLite. =Languages= ; Key words Compiled, interpreted, object orientated, functional Java Tbd * JUnit4 with table / parameters click Python Tbd Swift Refer to DevOpsMemo#iOS for development memo on platform of iPhone. Refer to visual studio code for swift on windows * Learning Swift Memo ** Swift Programming Language click * Json to swift online tool click Swift on Ubuntu * example project click ** code and tests example git clone https://github.com/apple/example-package-dealer * editor::atom click and its plugins apm::swift-debugger click =General Areas= SCM Branching Strategy * Git `git clone --branch remote-name --single-branch https://github.com/android.git` * Gitflow - 2010 click * Gitflow - 2013 click * Gitflow is Considered Harmful - 2015 first-post follow-up PC * JVM Mobile * Appium a general mobile testing framework Android Android on Ubuntu * adb devices - refer to stackoverflow ** `lsusb` Bus 002 Device 103: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone S II ** create file `/lib/udev/rules.d/10-adb.rules` with content SUBSYSTEM "usb", ATTR{idVendor} "04e8", ATTR{idProduct} "6860", MODE="0600", OWNER="username" Handy Android Commands * Light up screen from command line adb shell input keyevent 82 adb shell input keyevent 26 #Pressing the lock button adb shell input touchscreen swipe 930 880 930 380 #Swipe UP adb shell input text XXXX #Entering your passcode adb shell input keyevent 66 #Pressing Enter Refer to for more Android Gradle android{ lintOptions { //abortOnError false disable 'InvalidPackage' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } test { useJUnit { includeCategories 'org.gradle.junit.CategoryA' excludeCategories 'org.gradle.junit.CategoryB' } } Instrumentation * Espresso ** Espresso click *** ViewMatchers click assertThat(String message, T actual, Matcher matcher) *** Hamcrest click *** Cheat Sheet click *** ViewActions.java click *** Recipes click ** Espresso vs UiAutomator click ** Espresso Advanced Samples click ** Android user interface testing with Espresso - Tutorial click ** Espresso + BDD *** epresso-cucumber click *** cucumber-jvm and android click * robolectric.org testing framework ** Robolectric lets you run your tests on your workstation, or on your Continuous Integration environment in a regular JVM, without an emulator. * Espresso, Mockito and Dagger dagger2 ** Fast and reliable UI tests on Android click ** Introduction to Automated Android Testing click Mock * mockito click RxJava * Going Reactive: An Architectural Journey click iOS * Install Mac OS Yosemite on PC unibeast yosemite-zone * How To Make An iPhone App - with Swift click * Develop iOS App with Swift click ; Where to Put Code click * Expect your app to be a sort of tree of references from the AppDelegate to one class instance (like a main UIViewController), which will have references to other class instances (like a UIView and other UIViewControllers), and so on * In a UIViewController, expect to do most of your setup in viewDidLoad * At first, you can probably do most of what you need to do without subclassing UIView at all, unless you need to use drawRect: or override other UIView methods, using a view instead of a view controller is mostly organizational * In a UIView, do most of your setup (i.e. creating subviews) in init (save drawRect: for actual drawing only) * If you're trying to create a more complex layout, don't forget about layoutSubviews for adjusting subview frames and so on * For now, bias to using properties instead of ivars, you can create a private @interface if you don't want to expose a property to other classes * Read the documentation for UIViewController's viewWillAppear, viewDidAppear, viewWillDisappear, and viewDidDisappear (all pretty succinct and once you start to do anything remotely complex you will need to override these methods) SCM Fastlane * Scan * Gym * Snapshot Gradle Not quite working for now. UI Programming * UIView - programming guide click * Implement a custom control click * iOS Basically: Reusable UIView part1 part2 * iOS – Developing reusable Views in a Swift Framework click UI Automation * UI Testing in Xcode - wwdc2015 click * UI Testing in Xcode 7 Part 1: UI Testing Gotchas * masilotti click ** ui testing cheat sheet click * Accessibility click ** Do NOT set isAccessibilityElement=True to container view * XCUITest cheat-sheet click BDD on iOS * XCFit click * Fastlane Cucumberish click * Fitnesse Http Request * NSURLConnection click deprecated * USURLSession click * Alamofire click * With Swift NSURLSession click Mock Server * Kakapo swift Pkg * Install the package sudo installer -pkg swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a-osx.pkg -target / * Unpack package pkgutil --expand swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a-osx.pkg swift-unpkg * mv Payload payload.pax.gz * Unzip payload gunzip -v payload.pax.gz * Unpax payload pax -r -f payload.pax * List installation lsbom -fls /Library/Receipts/some_app.pkg/Contents/Archive.bom ** Delete installation lsbom -fls /Library/Receipts/some_app.pkg/Contents/Archive.bom | (cd /; sudo xargs rm) =Web and Service= * WSDL * WADL impl w3 xsd * YAML * Swagger ** Tutorial 1 intro ** Swagger Specification tutorial click * RAML ** atom+api-workbench `apm install api-workbench` ** raml tutorial click * raml, swagger or blueprint click * postman to swagger stack overflow online convert JSON * Convert json and Java www.jsonschema2pojo.org ** json to schema online genson tools * json2c# json2csharp.com * json2yaml www.json2yaml.com API Endpoints * media tatts media.tatts.com documentations/Default.html ** import subprocess import sys TPL = """ @SerializedName("%(name)s") @Expose public %(dtype)s %(vname)s; """ def translateDataType(dtype): if "Int32" dtype or "Int16" dtype: return "int" if "Int32[]" dtype: return "int[]" if "Int64[]" dtype: return "long" if "Int64" dtype: return "long[]" if "DateTime" dtype: return "String" if "Boolean" dtype: return "boolean" if "Decimal" dtype: return "double" return dtype def procLine(line): subs = line.split('\t') name = None dtype = None if len(subs) > 1: name = subs0 dtype = subs1 # else: # subs = line.split() # if len(subs) >= 2: # name = subs0 # dtype = subs1 if name is None: print("ignore this line:" + line) return varName = "%s%s" % (name0.lower(), name1:) dtype = translateDataType(dtype) return (TPL % {"name":name, "vname":varName, "dtype":dtype}) def writeToClipboard(raw): process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE) process.communicate(raw.encode('utf-8')) def main(): arg1 = sys.argv1 buf = "" with open(arg1) as f: lines = f.readlines() for line in lines: buf += procLine(line.strip()) buf += "\n" writeToClipboard(buf) print(buf) if __name__ "__main__": exit(main()) =SCM= Gradle Tbd =Books= * 影印版 * weibo user collection ** it-ebooks-2016 click ** it-ebooks-2015 click ** it-ebooks-2014 click =Videos= * Standford 193P videos click objective-c * WWDC click =Hardwares= Keyboards * Tbd Desktops * Optiplex 790 / 990 click ** DisplayPort to HDMI *** UNITEK (Y-6332) DisplayPort to HDMI Female (Support 4K) Converter - $ 11.00 *** Comsol DisplayPort to HDMI 4K2K Adaptor - $34.88 * HP Compaq 6200 / 6300 Pro; 8000 / 8100 / 8200 Elite click * Lenovo ThinkCentre click =Softwares= Operating Systems * Yosemite ** Unibeast click ** Hackintosh click ** x86 list click * Ubuntu click ** Swift Unit Testing on Ubuntu click =Appendix= Tbd